const express = require("express");
// 导入session中间件
const session = require("express-session");
// 导入路由组件
const router = require("./router");

// 2. 创建应用对象
const app = express();

app.use(session({
    secret: 'keyboard cat',
    resave: false,
    saveUninitialized: true,
}))

app.use(express.urlencoded({ extended: true }));

app.use('/api',router);


app.listen(3000, () => {
    console.log("服务器启动成功~");
})